package main
import ."fmt"

func main()  {
	array := [] int {1,2,3,4,5,6,6,1,7,7,8,9,5,3,22,33,5,688,67,77,11}
	Println(array)
	odd:=filter(array,isOdd)
	Println(odd)
	even:=filter(array,isEven)
	Println(even)
}

func init() {
	Println("this is init fun ")
}

func init() {
	Println("this is init fun2 ")
}


type testInt func(int) bool

func isOdd(a int) bool  {
	return a%2==0
}


func isEven(a int) bool  {
	return a%2 >0
}

func filter(slice [] int , f testInt) (s [] int)  {
	var sss []int
	for _,k:=range slice  {
		if f(k){
			sss = append(sss,k)
		}
	}
	return sss
}

